#pragma once

#include "Game/Process/RenderProcess.h"
#include "Render/Texture/Picture2DTexture.h"
#include "Render/Texture/RenderTarget.h"
#include "Render/Tradition/RHIRenderPass.h"
#include "Render/Tradition/GraphicsPipeline.h"
#include "Render/Texture/ColorRenderTarget.h"
#include "Render/Texture/DepthRenderTarget.h"
#include "Render/Shader/RHIDescriptor.h"
#include "Render/Tradition/RHIFramebuffer.h"
#include "LocalEntity.h"
#include "LocalMath.h"

class LocalScene;

class ForwardPlusProcess : public RenderProcess
{
	DECLARE_PROCESS(ForwardPlusProcess)

	struct PushConstants
	{
		glm::ivec2 viewportSize;
		glm::ivec2 tileNum;
		int32 debugIndex;
	};

public:

	std::vector<PointLight> mPointLights;

	PushConstants mPushConstants;

	int32 mTileCountPerRow;

	int32 mTileCountPerCol;

protected:

	virtual void OnInit() override;

	virtual void OnTick(float deltaTime) override;

	virtual void OnResize() override;

protected:

	LocalScene* mLocalScene;

	LocalEntity* mSceneEntity;

	int32 mObjectSize;







	RefCountPtr<RHIBuffer> mPointLightsBuffer;

	RefCountPtr<RHIBuffer> mTileLightVisiblitiesBuffer;



	RefCountPtr<ColorRenderTarget> mColorRenderTarget;

	RefCountPtr<DepthRenderTarget> mDepthRenderTarget;

	RefCountPtr<RHIDescriptor> mDescriptor;

	

	RefCountPtr<GraphicsPipeline> mPipeline;

	RefCountPtr<RHIRenderPass> mRenderPass;

	RefCountPtr<RHIFrameBuffer> mFrameBuffer;
};
